package com.zcq.dm.enums;


import com.zcq.dm.utils.DataMaskingUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.function.Function;

/**
 * 脱敏数据类型
 */
@Getter
@AllArgsConstructor
public enum DMTypeEnum {

    PHONE(70, "手机号", DataMaskingUtil::phoneFilter),

    ID_NO(80, "身份证号", DataMaskingUtil::idNoFilter),

    BANKCARD_NO(81, "银行卡", DataMaskingUtil::bankNoFilter),

    LIVING_ADDRESS(82, "居住地址", DataMaskingUtil::addressFilter),

    BIRTH_ADDRESS(83, "户籍地址", DataMaskingUtil::addressFilter),

    COMPANY_ADDRESS(84, "公司地址", DataMaskingUtil::addressFilter),
    ;

    private final Integer code;

    private final String name;

    //脱敏方法
    private Function<String, String> dsMethod;

}

